home *** CD-ROM | disk | FTP | other *** search
/ Amiga Plus 2002 #11 / Amiga Plus CD - 2002 - No. 11.iso / Tools / Development / PowerD / mui_htmltext / example / HTMLtext-DEMO.d next >
Encoding:
Text File  |  2002-10-28  |  2.7 KB  |  71 lines

  1. /*
  2.  
  3. HTMLTEXT MUI CLASS PowerD Example by Philippe van Calsteren in 2002.
  4. --------------------------------------------------------------------
  5. Converted from the existing AmigaE source in the development package
  6.  
  7. */
  8.  
  9. MODULE 'lib/amiga'
  10. MODULE 'muimaster', 'libraries/mui'
  11. MODULE 'utility/tagitem', 'utility/hooks'
  12. MODULE 'intuition/classes', 'intuition/classusr'
  13. MODULE 'libraries/gadtools','exec/memory'
  14. MODULE 'asl','libraries/asl'
  15. MODULE 'graphics/displayinfo'
  16. MODULE  'muimaster','libraries/mui','utility/tagitem','intuition/classes',
  17.         'intuition/classusr','utility/hooks', 'mui/htmltext_mcc'
  18.  
  19. DEF ap_Test=NIL,wi_Test=NIL,running,result,signal,html,string
  20. DEF MUIMasterBase, ASLBase
  21. ENUM NONE,NOMUI,BADGUI
  22.  
  23. PROC main()
  24.     IF (MUIMasterBase := OpenLibrary(MUIMASTER_NAME,MUIMASTER_VMIN))=NIL THEN Raise(NOMUI)
  25.     IF (ASLBase:=OpenLibrary('asl.library',39))=NIL THEN Raise(NONE)
  26.  
  27.     ap_Test:=   ApplicationObject,
  28.                     MUIA_Application_Base,'HTMLTEXTDEMO',
  29.                     MUIA_Application_Title,'HTMLtext-DEMO',
  30.                     SubWindow, wi_Test:=WindowObject,
  31.                         MUIA_Window_Title,'HTMLtext-DEMO',
  32.                         MUIA_Window_ID,123456,
  33.                        
  34.                         WindowContents,VGroup,                                            
  35.                             Child,html:=HTMLtextObject, /* create the object */
  36.                                 TextFrame,
  37.                                 End,
  38.                             Child,string:=StringObject,
  39.                                 StringFrame,
  40.                                 End,
  41.                             End,
  42.                         End,
  43.                     End
  44.  
  45.     IF ap_Test=NIL THEN Raise(BADGUI)
  46.  
  47.     /* we want to show changes by the HTMLtextObject so we put a notification on
  48.        the string gadget which will then update the HTML display */
  49.  
  50.     DoMethod(string, MUIM_Notify,MUIA_String_Contents,MUIV_EveryTime,html,3,MUIM_Set,MUIA_HTMLtext_Contents,MUIV_TriggerValue)
  51.     DoMethod(wi_Test,MUIM_Notify,MUIA_Window_CloseRequest,MUIV_EveryTime,ap_Test,2,MUIM_Application_ReturnID,MUIV_Application_ReturnID_Quit)
  52.     set(string,MUIA_String_Contents,'<hr>This <i>is a <small>small</small> <big>Demo</big></i> of he <b>HTMLtext class</b>.<hr>')
  53.     set(wi_Test,MUIA_Window_Open,MUI_TRUE)
  54.  
  55.     running:=1
  56.     /* the ideal input loop... */
  57.  
  58.     WHILE running
  59.         IF CtrlC() THEN running:=FALSE
  60.         result:=DoMethod(ap_Test,MUIM_Application_Input,&signal)
  61.         SELECT result
  62.             CASE MUIV_Application_ReturnID_Quit
  63.                 running:=FALSE
  64.         ENDSELECT
  65.         IF signal THEN Wait(signal)
  66.     ENDWHILE
  67.     Raise(NONE)
  68. EXCEPT
  69.     IF ap_Test THEN MUI_DisposeObject(ap_Test)
  70.     IF MUIMasterBase THEN CloseLibrary(MUIMasterBase)
  71. ENDPROC